﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WXWorkSvc.Common.Migrations
{
    /// <inheritdoc />
    public partial class t3 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_Logger8",
                table: "Logger8");

            migrationBuilder.RenameTable(
                name: "Logger8",
                newName: "Loggers8");

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Loggers8",
                type: "nvarchar(450)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");

            migrationBuilder.AlterColumn<long>(
                name: "Id",
                table: "Loggers8",
                type: "bigint",
                nullable: false,
                oldClrType: typeof(long),
                oldType: "bigint")
                .Annotation("SqlServer:Identity", "9223372036854775807, -1")
                .OldAnnotation("SqlServer:Identity", "1, 1");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Loggers8",
                table: "Loggers8",
                column: "Id");

            migrationBuilder.CreateIndex(
                name: "IX_Loggers8_AppId_Name_LogLevel",
                table: "Loggers8",
                columns: new[] { "AppId", "Name", "LogLevel" });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_Loggers8",
                table: "Loggers8");

            migrationBuilder.DropIndex(
                name: "IX_Loggers8_AppId_Name_LogLevel",
                table: "Loggers8");

            migrationBuilder.RenameTable(
                name: "Loggers8",
                newName: "Logger8");

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Logger8",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(450)");

            migrationBuilder.AlterColumn<long>(
                name: "Id",
                table: "Logger8",
                type: "bigint",
                nullable: false,
                oldClrType: typeof(long),
                oldType: "bigint")
                .Annotation("SqlServer:Identity", "1, 1")
                .OldAnnotation("SqlServer:Identity", "9223372036854775807, -1");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Logger8",
                table: "Logger8",
                column: "Id");
        }
    }
}
